import Vue from 'vue'
import App from './App.vue'

// 第一级路由
import Contacts from "./views/Contacts.vue"

// 第二级路由
import All_contacts from './views/second/All_contacts.vue';
import Alice from "./views/second/Alice.vue"
import Bob from "./views/second/Bob.vue"

Vue.config.productionTip = false

import vueRouter from "vue-router"
Vue.use(vueRouter)
let routes = [{
    path: "/",
    redirect: "/contacts"
  },
  {
    path: "/contacts",
    component: Contacts,
    children: [{
        name: "all_contacts",
        path: "all_contacts",
        component: All_contacts
      },
      {
        name: "alice",
        path: "alice",
        component: Alice
      },
      {
        name: "bob",
        path: "bob",
        component: Bob
      }
    ]
  }
]

let router = new vueRouter({
  routes
})

new Vue({
  render: h => h(App),
  router
}).$mount('#app')